package com.wei.wordcount;

import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

public class WordCountMap extends Mapper<LongWritable, Text, Text, IntWritable>{

	@Override
	protected void map(LongWritable key, Text value,Context context)throws IOException, InterruptedException {
		String line= value.toString();
		String[] split = line.split(" ");
		for (int i = 0; i < split.length; i++) {
			context.write(new Text(split[i]), new IntWritable(1));
		}
	}
	
	

}
